package com.example.lin.day9_26;

import com.example.lin.day9_26.pojo.ResultData;
import com.example.lin.day9_26.pojo.User;

import java.util.List;

import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Field;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Query;

public interface IUserRequest {


    //http://192.168.3.100:8080/home/register
    @POST("register")
    @FormUrlEncoded
//表示需要提交 Form表单数据(POST键值对)
    Call<ResultData> register(@Field("userName") String userName, @Field("psw") String psw);

    //baseUrl/register?userName=值
    @GET("getUser")
    Call<ResultData<User>> getUser(@Query("userName") String userName);


    @POST("upload")
    @Multipart
    Call<ResultData> uploadIcon(@Part("content") String content, @Part List<MultipartBody.Part> files);

}
